﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Maticsoft.Common;

namespace Golf.WebUI.AdminShow.OrderManagement
{
    public partial class Golf_BankAdd : Golf.WebUI.App_code.ValidateLogin
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }	protected void btnSave_Click(object sender, EventArgs e)
		{
			
			string strErr="";
			if(this.txtBankName.Text.Trim().Length==0)
			{
				strErr+="银行名称不能为空！\\n";	
			}
			if(!PageValidate.IsNumber(txtAdminId.Text))
			{
				strErr+="添加管理人id Golf_Ad格式错误！\\n";	
			}
			if(!PageValidate.IsDateTime(txtAddTime.Text))
			{
				strErr+="添加时间格式错误！\\n";	
			}

			if(strErr!="")
			{
				MessageBox.Show(this,strErr);
				return;
			}
			string BankName=this.txtBankName.Text;
			int AdminId=int.Parse(this.txtAdminId.Text);
			DateTime AddTime=DateTime.Parse(this.txtAddTime.Text);

			Golf.Model.Golf_Bank model=new Golf.Model.Golf_Bank();
			model.BankName=BankName;
			model.AdminId=AdminId;
			model.AddTime=AddTime;

			Golf.BLL.Golf_Bank bll=new Golf.BLL.Golf_Bank();
			bll.Add(model);
			Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功！","add.aspx");

		}


        public void btnCancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("list.aspx");
        }
    }
}